*use "C:\Users\carlhk\Dropbox\Exconstpaper\ACLP\Analyser\coups_chked.dta", clear
********************************************************************************use "M:\pc\Dokumenter\Doktorgradsprosjekt\acpl\knutsen.dta", clear
********************************************************************************use "M:\Af�rsteam\samarbartikler\aclp\knutsen.dta", clear

***********************************************************
******      REPLICATION FILE FOR: KNUTSEN AND WIG   *******
******      Comparative Political Studies (forthc.) *******
* Government Turnover and the Effects of Regime Type: How *
* Requiring Alternation in Power Biases against the       *
*         Estimated Economic Benefits of Democracy		  * 
***********************************************************
use "C:\Users\carlhk\Dropbox\Exconstpaper\ACLP\Replication files\Knutsen_Wig_CPS_final.dta", clear

*Defining panel structure
xtset gwno year
sort gwno year

keep gwno year GDPpc_Maddison population_Maddison logpop_Mad logGDPpc_Mad polity_x lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears attempt milreg chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  acdspline1 acdspline2  acdspline3  polity2_x durable growthgdppc_Mad lead5growthgdppc_Mad logregdur _1940s _1950s _1960s _1970s _1980s _1990s _2000s ethnfrac westeurplusoffshots easteursov africass asiapac mideanafr latam sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous britishameric french portugese spanish belgian italian dutch inreversewave fh_cl fh_pr FHI growthoilinc logoilinc country_x type2 democracy ddconstructed democracynoalt dem_realtimeDD dem_realtimePIPE type2_realtimeDD type2_realtimePIPE democracy_miscodedDD democracynoaltlag salterel2 realtimeDDtrans type2_realtimeDDlag country_y abbreviation bdemocracy sovereign democracy_trans democracy_breakdowns democracy_duration democracy_omitteddata forties fifties sixties seventies eighties nineties zeroes gwthlag1 gwthlag2 gwthlag3 gwthlag4 gwthlag5 gwthlag6 gwthover5yrs democracylag demrealtimeddlag bdemocracylag country_x lpopl lgdpcapl onsetfl2 fpeaceyears fspline1 fspline2 fspline3 acdpeaceyears acdspline1 acdspline2 acdspline3 acdonset2 acdonset3 cdem caut cdem03 caut03 anoc polity_y polity2_y cdem03r caut03r demtyp2b attempt success chgdp chmilex soquall lmilper counterbal dem auth lgdppcl instab milreg powthy_peace spline1 spline2 spline3 EffectiveNumber paramilitary dem_realtimeDDs cowcode gwf_casename gwf_country gwf_regimetype gwf_next gwf_prior gwf_spell gwf_duration gwf_fail gwf_party gwf_military gwf_monarchy gwf_personal gwf_nonautocracy gwf_disagree country_y dem_realtimeDD2

*Generating alternative democracy measures (recoding type 2, and then, below, recoding only Botswana
generate dem_notyp2e = .
replace dem_notyp2e = 0 if democracy==0 & type2==0
replace dem_notyp2e = 1 if democracy==1 | type2==1
summarize  dem_notyp2e democracy type2, detail

generate democracy_botswana = democracy
replace democracy_botswana =1 if gwno==571



****************************************************************
**************************TABLE 1*******************************
****************************************************************

xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Checking recoded countries for Model II, Table 1

generate democracyrecodeMITI = dem_notyp2e-democracy if _est_a1==1
summarize democracyrecodeMITI
sort gwno year
browse gwno country_y year if democracyrecodeMITI==1

**For the measure based on DDs coding rules and not the Cheibub et al coded data

generate democracyrecodeMITIa = democracynoalt-ddconstructed if _est_a1==1
summarize democracyrecodeMITIa

**Checking recoded countries for Model II, Table 3
tabulate democracy_botswana if democracy==0 & _est_a1==1

**Checking recoded countries for Model II, Table 5
generate democracyrecodeMVTI = bdemocracy-democracy if _est_a6==1
tabulate democracyrecodeMVTI
sort gwno year
browse gwno country_y year democracyrecodeMVTI if democracyrecodeMVTI!=0 & democracyrecodeMVTI!=.
browse gwno country_y year democracyrecodeMVTI democracy bdemocracy if democracyrecodeMVTI==1
browse gwno country_y year democracyrecodeMVTI democracy bdemocracy if democracyrecodeMVTI==-1


****************************************************************
**************************TABLE 2*******************************
****************************************************************

treatreg lead5growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy  = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a1
treatreg lead5growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(dem_notyp2e = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a2
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(bdemocracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a3
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy_botswana = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a4
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, treat(democracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a5

estout  a1 a2 a4 a5 a3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


***Checking recoded observations for, respectively, Models II, III, and V in Table 2, and further

generate democracyrecodeMITIh = dem_notyp2e-democracy if _est_a1==1
tabulate democracyrecodeMITIh
sort gwno year
browse gwno country_y year if democracyrecodeMITIh==1

tabulate democracy_botswana if democracy==0 & _est_a1==1

generate democracyrecodeMVTIh = bdemocracy-democracy if _est_a5==1
tabulate democracyrecodeMVTIh
sort gwno year
browse gwno country_y year democracyrecodeMVTIh if democracyrecodeMVTI!=0 & democracyrecodeMVTIh!=.
browse gwno country_y year democracyrecodeMVTIh democracy bdemocracy if democracyrecodeMVTIh==1
browse gwno country_y year democracyrecodeMVTIh democracy bdemocracy if democracyrecodeMVTIh==-1


****************************************************************
**************************TABLE 3*******************************
****************************************************************
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**identifying recoded observations, notice that the realtimeDD measure used in this table is the one not invoking CGV override rule, and there are thus also a few real-time democracies scored as autocracies on this particular measure.
generate samplechecka = democracy- dem_realtimeDD if _est_a1rtzq==1
tabulate samplechecka
generate samplecheckb = democracy- dem_realtimeDD if _est_a2rtzq==1
tabulate samplecheckb
generate samplecheckc = democracy- dem_realtimeDD if _est_a3rtzq==1
tabulate samplecheckc

******************************************************************
************A.6 Rob tests of Models in Section 4.1****************
******************************************************************


*Constructing RE versions of TABLE 1, Table A.6
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, re cluster(gwno)
estimates store a1r
xtreg lead5growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, re cluster(gwno)
estimates store a2r
xtreg lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, re cluster(gwno)
estimates store a3r
xtreg lead5growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, re cluster(gwno)
estimates store a4r
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3r==1, re cluster(gwno)
estimates store a5r
xtreg lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5r==1, re cluster(gwno)
estimates store a6r

estout  a1r a2r a4r a5r a6r, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*Constructing FE versions of TABLE 1; Table A.7
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, fe cluster(gwno)
estimates store a1f
xtreg lead5growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, fe cluster(gwno)
estimates store a2f
xtreg lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, fe cluster(gwno)
estimates store a3f
xtreg lead5growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, fe cluster(gwno)
estimates store a4f
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3f==1, fe cluster(gwno)
estimates store a5f
xtreg lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5f==1, fe cluster(gwno)
estimates store a6f

estout  a1f a2f a4f a5f a6f, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)



by gwno, sort: generate lead1growthgdppc_Mad = growthgdppc_Mad[_n+1]
sort gwno year
**1-year time lags (Table A.8)
xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1l1
xtpcse lead1growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2l1
xtpcse lead1growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3l1
xtpcse lead1growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4l1
xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3l1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5l1
xtpcse lead1growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5l1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6l1

estout  a1l1 a2l1 a4l1 a5l1 a6l1, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


by gwno, sort: generate lead3growthgdppc_Mad = growthgdppc_Mad[_n+3]
sort gwno year
**3-year time lags (Table A.9)
xtpcse lead3growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1l3
xtpcse lead3growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2l3
xtpcse lead3growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3l3
xtpcse lead3growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4l3
xtpcse lead3growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3l3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5l3
xtpcse lead3growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5l3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6l3

estout  a1l3 a2l3 a4l3 a5l3 a6l3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Robustnes test with lagged growth, 5 years, as independent variable (Table A.10)
xtpcse lead5growthgdppc_Mad growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Robustnes test with lagged growth, 1 year, as independent variable (Table A.11)
xtpcse lead1growthgdppc_Mad growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead1growthgdppc_Mad growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead1growthgdppc_Mad growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead1growthgdppc_Mad growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead1growthgdppc_Mad growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead1growthgdppc_Mad growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6


estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


***Robustness testing Table 1 by including ln regime duration as additional control
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad logregdur ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad logregdur ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad logregdur ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad logregdur ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad logregdur ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad logregdur ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


by gwno, sort: generate laglogpopmad = logpop_Mad[_n-1]
by gwno, sort: generate popgrmad = logpop_Mad-laglogpopmad
sort gwno year

***Robustness testing Table 1 by including population growth as additional control (Table A.13)
xtpcse lead5growthgdppc_Mad popgrmad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad popgrmad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad popgrmad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad popgrmad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad popgrmad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad popgrmad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Robustness testing Table 1 by including ln oil income as additional control (Table A.14)
xtpcse lead5growthgdppc_Mad logoilinc democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad logoilinc dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad logoilinc bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad logoilinc democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad logoilinc democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad logoilinc bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Robustness testing Table 1 by including plurality religion  as additional control (Table A.15)
xtpcse lead5growthgdppc_Mad democracy sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad dem_notyp2e sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad bdemocracy sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad democracy_botswana sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad democracy sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad bdemocracy sunni shia catholic protestanglic orthodox hindu budhkonfutaoshinto indigeneous logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


***Excluding GWF "non-regimes"

generate GWFnonregime =.

replace GWFnonregime = 0 if gwf_nonautocracy =="NA"
replace GWFnonregime = 0 if gwf_nonautocracy =="democracy"

replace GWFnonregime = 1 if gwf_nonautocracy =="foreign-occupied"
replace GWFnonregime = 1 if gwf_nonautocracy =="not-independent"
replace GWFnonregime = 1 if gwf_nonautocracy =="provisional"
replace GWFnonregime = 1 if gwf_nonautocracy =="warlord"
replace GWFnonregime = 1 if gwf_nonautocracy =="warlord/foreign-occupied"

tabulate GWFnonregime


***Restricting sample by excluding GWF "non-regimes" in Table A.16
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad dem_notyp2e logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1 & GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2
xtpcse lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad democracy_botswana logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1 & GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad bdemocracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1 & GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

estout  a1 a2 a4 a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)



*****Testing the early, independent democracies miscoded as dictatorships thesis

generate GWFdemocracy =.

replace GWFdemocracy = 1 if gwf_nonautocracy =="democracy"
replace GWFdemocracy = 0 if gwf_nonautocracy =="NA"
replace GWFdemocracy = 0 if gwf_nonautocracy =="foreign-occupied"
replace GWFdemocracy = 0 if gwf_nonautocracy =="not-independent"
replace GWFdemocracy = 0 if gwf_nonautocracy =="provisional"
replace GWFdemocracy = 0 if gwf_nonautocracy =="warlord"
replace GWFdemocracy = 0 if gwf_nonautocracy =="warlord/foreign-occupied"

tabulate GWFdemocracy

by democracy, sort:summarize GWFdemocracy
sort gwno year

generate GWFdem_recoded_DD = democracy
replace GWFdem_recoded_DD = 1 if GWFdemocracy==1
*156 regimes recoded
browse country_x gwno year GWFdem_recoded_DD GWFdemocracy democracy if GWFdem_recoded_DD == 1 & democracy==0


**Table A.17 Run regressions comparing dd with adjusted measure: Recoding observations (on DD) that are coded as ditatorships by DD, but as democracies by GWF
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1
xtpcse lead5growthgdppc_Mad GWFdem_recoded_DD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2

xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad GWFdem_recoded_DD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a1==1 & GWFnonregime!=1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a4
estout  a1 a2 a3 a4, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Identifying recoded observations
summarize GWFdem_recoded_DD if GWFdem_recoded_DD==1 & democracy==0 & _est_a1==1
summarize GWFdem_recoded_DD if GWFdem_recoded_DD==1 & democracy==0 & _est_a3==1

browse country_x gwno year GWFdem_recoded_DD if GWFdem_recoded_DD==1 & democracy==0 & _est_a1==1

***Running test when only recoding regimes on dd that are dictatorships on DD but are democratic on BMR
generate democracybmrrecode = democracy
replace democracybmrrecode = 1 if democracy==0 & bdemocracy==1
summarize democracybmrrecode if democracy==0 & bdemocracy==1

xtpcse lead5growthgdppc_Mad democracybmrrecode logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a5
xtpcse lead5growthgdppc_Mad democracybmrrecode logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a5==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a6

summarize democracybmrrecode if democracy==0 & bdemocracy==1
summarize democracybmrrecode if democracy==0 & bdemocracy==1 & _est_a6==1

estout  a5 a6, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

******************************************************************
**********************Rob tests of Section 4.2********************
******************************************************************

**Here is Table 2 regressions again, needed also for generating 1st stage results displayed in Table A.18
treatreg lead5growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy  = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a1
treatreg lead5growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(dem_notyp2e = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a2
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(bdemocracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a3
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy_botswana = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a4
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, treat(democracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a5

estout  a1 a2 a4 a5 a3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Including log regime duration (Table A.19)
treatreg lead5growthgdppc_Mad logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy  = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a1
treatreg lead5growthgdppc_Mad logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(dem_notyp2e = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a2
treatreg lead5growthgdppc_Mad logregdur  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(bdemocracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a3
treatreg lead5growthgdppc_Mad logregdur  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy_botswana = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a4
treatreg lead5growthgdppc_Mad logregdur  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, treat(democracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a5

estout  a1 a2 a4 a5 a3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


***Using 1 year lags on independent variables (Table A.20)
treatreg lead1growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy  = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a1
treatreg lead1growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(dem_notyp2e = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a2
treatreg lead1growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(bdemocracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a3
treatreg lead1growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*, treat(democracy_botswana = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a4
treatreg lead1growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1, treat(democracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a5

estout  a1 a2 a4 a5 a3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)



***Testing treatment effects models up until year 1990 (Table A.21)
treatreg lead5growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(democracy  = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a1
treatreg lead5growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(dem_notyp2e = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a2
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(bdemocracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a3
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(democracy_botswana = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a4
treatreg lead5growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1 & year<1991, treat(democracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a5

estout  a1 a2 a4 a5 a3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


***Testing treatment effects models up until year 1990 and with 1 year lag  (Table A.22)
treatreg lead1growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(democracy  = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a1
treatreg lead1growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(dem_notyp2e = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a2
treatreg lead1growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(bdemocracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a3
treatreg lead1growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, treat(democracy_botswana = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a4
treatreg lead1growthgdppc_Mad  logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if _est_a3==1 & year<1991, treat(democracy = inreversewave logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19*) vce(cluster gwno) first
estimates store a5

estout  a1 a2 a4 a5 a3, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

*****************************************************************************************
************Robustness tests for Section 4.3*********************************************
*****************************************************************************************

generate diffrealtime = dem_realtimeDD2 - dem_realtimeDD
tabulate diffrealtime
browse gwno year diffrealtime dem_realtimeDD2 dem_realtimeDD democracy

**Table 3 models, but with 1-year lags (Table A.23)

xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead1growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead1growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead1growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead1growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead1growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead1growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead1growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


***Robustness test of table 3 with lagged growth as additional control (Table A.24)
xtpcse lead5growthgdppc_Mad democracy growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

xtpcse lead5growthgdppc_Mad democracy growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD growthgdppc_Mad logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Robustness test of table 3 with regime duration as additional control (Table A.25)
xtpcse lead5growthgdppc_Mad democracy logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

xtpcse lead5growthgdppc_Mad democracy logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logregdur logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Estimating Table 3, but with fixed effects (Table A.26)
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, fe cluster(gwno)
estimates store a1rtzq
xtreg lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, fe cluster(gwno)
estimates store a1rt2zq
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, fe cluster(gwno)
estimates store a2rtzq
xtreg lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, fe cluster(gwno)
estimates store a2rt2zq
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, fe cluster(gwno)
estimates store a3rtzq
xtreg lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, fe cluster(gwno)
estimates store a3rt2zq

xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1, fe cluster(gwno)
estimates store a1rtzq
xtreg lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1, fe cluster(gwno)
estimates store a1rt2zq
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1, fe cluster(gwno)
estimates store a2rtzq
xtreg lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1, fe cluster(gwno)
estimates store a2rt2zq
xtreg lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1, fe cluster(gwno)
estimates store a3rtzq
xtreg lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1, fe cluster(gwno)
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

**Further inspecting the data (measured democratization experiences)
sort gwno year
by gwno, sort: generate lagdemoc = democracy[_n-1]
by gwno, sort: generate lagrealdemoc = dem_realtimeDD[_n-1]
sort gwno year

generate democratization = democracy-lagdemoc
generate realdemocratization = dem_realtimeDD - lagrealdemoc
browse country_x gwno year democracy lagdemoc democratization realdemocratization if realdemocratization !=. & realdemocratization!=0 & _est_a2rtzq==1
*nr of countries with change in 1970s regression
*25 countries with changes either to or from democracy
browse country_x year gwno democracy dem_realtimeDD

*USING the alternative realtime measure (with cgv override rule)
**Appendix Table A.27
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD2 logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD2 logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD2 logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD2 logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD2 logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD2 logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)

***Estimating Table 3 excluding Switzerland (Table A.28)
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rt2zq==1 & gwno!=225, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1971 & _est_a1rtzq==1 & gwno!=225, correlation(psar1) rhotype(tscorr) pairwise
estimates store a1rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rt2zq==1 & gwno!=225, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1981 & _est_a2rtzq==1 & gwno!=225, correlation(psar1) rhotype(tscorr) pairwise
estimates store a2rt2zq
xtpcse lead5growthgdppc_Mad democracy logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rt2zq==1 & gwno!=225, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rtzq
xtpcse lead5growthgdppc_Mad dem_realtimeDD logGDPpc_Mad logpop_Mad ethnfrac easteursov africass asiapac mideanafr latam _19* if year<1991 & _est_a3rtzq==1 & gwno!=225, correlation(psar1) rhotype(tscorr) pairwise
estimates store a3rt2zq

estout  a1rt2zq a1rtzq a2rt2zq a2rtzq a3rt2zq a3rtzq, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01 **** 0.001) stats (N)style (tex)


******************************************************
**********        CIVIL WAR LOGITS     ***************
******************************************************

*TABLE A29

*These models replicate cederman et.al 2010 (adding growth and ethnic fractionalization), and include different democracy measures

****DD democracy
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store civ1

****Democracy (without alternation rule)
logit acdonset2 democracynoalt lgdpcapl lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store civ2

        *this is to exclude observations from sample (BMR)
logit acdonset2 bdemocracy lgdpcapl  lpopl  gwthover5yrs  ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store bmr1

***ON bmr sample
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs  ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year if _est_bmr1==1, cluster(gwno)
estimates store civ3

****Boix democracy
logit acdonset2 bdemocracy lgdpcapl  lpopl  gwthover5yrs  ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store civ4

estout civ1 civ2 civ3 civ4, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


**************************
*** Real Time vs. DD  ****
**************************

*TABLE A30

*original
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1970, cluster(gwno)
estimates store civ1a

*real-time
logit acdonset2 dem_realtimeDD lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1970, cluster(gwno)
estimates store civ2a

*original
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1980, cluster(gwno)
estimates store civ3a

*real-time
logit acdonset2 dem_realtimeDD lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1980, cluster(gwno)
estimates store civ4a

*original
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1990, cluster(gwno)
estimates store civ5a

*real-time
logit acdonset2 dem_realtimeDD lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1990, cluster(gwno)
estimates store civ6a


estout civ1a civ2a civ3a civ4a civ5a civ6a, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)




******************************************************
**********        COUP LOGITS          ***************
******************************************************


*TABLE A31

*these models replicate powell and Thyne 2012 (JCR), and include different democracy measures
*note: Powell and thyne create a regime-measure with three categories "dem", "auth" and the ref.cat which is anocracies. We drop all regime variables from their
*regressions and only use our binary measure

****REPLICATING POWELL AND THYNE

logit attempt dem auth milreg chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup0

****Replicating powell and thyne with binary democracy measure

     *DD
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup1

     *Democracy (without alternation rule)
logit attempt democracynoalt milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup2

     *Democracy on bmr sample
logit attempt bdemocracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3   , cluster(gwno)
estimates store bmr2	 
	 
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 if _est_bmr2==1 , cluster(gwno)
estimates store coup3

     *Boix democracy
logit attempt bdemocracy milreg  soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup4


estout  coup1 coup2 coup3 coup4, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


**************************
*** Real Time vs. DD  ****
**************************

*TABLE A32

*original
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1970, cluster(gwno)
estimates store coup1a

*real-time
logit attempt dem_realtimeDD milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 if year < 1970, cluster(gwno)
estimates store coup2a

*original
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1980, cluster(gwno)
estimates store coup3a

*real-time
logit attempt dem_realtimeDD milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1980, cluster(gwno)
estimates store coup4a

*original
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 if year < 1990, cluster(gwno)
estimates store coup5a

*real-time
logit attempt dem_realtimeDD milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1990, cluster(gwno)
estimates store coup6a



estout  coup1a coup2a coup3a coup4a coup5a coup6a, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*********************************************************************************************************************************************************
